public class Student {
    {  // 构造代码块开始
        this.name = "zhang san";
        System.out.println("调用了构造代码块");
        this.classroom = "302";
    }  // 构造代码块结束
    public String classroom = "301";
    public  String name;
    public  static String ID;
    public  static int age ;
//    public Student(String name ,String classroom) {
//        this.name = name;
//        this.classroom = classroom;
//        System.out.println("调用了两个参数的构造方法");
//   }
    static {  //静态构造块开始
        ID = "202201006106";
        System.out.println("调用了静态构造代码块");
        age = 15;
    }  //静态构造块结束



    public static void main(String[] args) {
        Student s = new Student();
        System.out.println(s.classroom);
    }
}

//class CollegeStudent extends Student{
//    protected String xy;
//    protected String bj;
//    void set(String xy,String bj) //设置数据的方法
//    {
//        this.xy=xy;
//        this.bj=bj;
//    }
//    public void printf() //输出数据的方法
//    {
//        System.out.println(xy+", "+bj);
//    }
//    public static void main(String[] args) {
//        CollegeStudent s = new CollegeStudent();
//        s.setdata("大明", 9466);
//        s.set("计科","寒门");
//        s.print();
//        s.printf();
//        System.out.println(s);
//    }
//}
class Point{
    public double x1;
    public double y1;

    public Point(double x1, double y1) {
        this.x1 = x1;
        this.y1 = y1;
    }
}

class Line extends Point{
    public double x2;
    public double y2;
    public Line(double x1, double y1, double x2, double y2) {
        super(x1, y1);
        this.x2 = x2;
        this.y2 = y2;
    }
    public double length(){
        return Math.sqrt(Math.pow(super.x1 - this.x2, 2) + Math.pow(super.y1 - this.y2, 2));
    }
    public String toString(){
        return "长度为" + this.length();
   }
}

class TestLine{
    public static void main(String[] args) {
        Line s = new Line(1, 1, 2, 2);
        System.out.println(s);
    }
}

